package com.cc8w.home.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.cc8w.entity.UserEntity;
import com.cc8w.home.service.UserService;



@Controller("homeIndex")
@RequestMapping("/home/index")
public class IndexController {

    
  //引入dubbo接口项目的接口,调用的是provider的实现类
    //@Reference(version = "1.0.0", url = "zookeeper://127.0.0.1:2181")
    @Reference(version = "1.0.0")
    private UserService userServiceImpl1;
    
    @Reference(version = "1.0.0")
    private com.cc8w.admin.service.UserService userAdminService;


    @RequestMapping("/index")
    @ResponseBody
    public Object index(){

        System.out.println(222);
        return userServiceImpl1.getUser(1);

    }


    @RequestMapping("/admin_user")
    public String adminUser(){
    	UserEntity u = userAdminService.queryUserByUserName("admin");
        System.out.println(u);
        return "index";

    }



    @RequestMapping("/jsp")
    public String jsp(){

        System.out.println(222);
        return "index";

    }



}